﻿@*
Don't forget to reference the JQuery Library here, inside your view or layout.
<script src="@Url.Content("~/Scripts/jquery-x.x.x.min.js")" type="text/javascript"></script>
*@

<script src="@Url.Content("~/Scripts/tinymce.3.4.5/jquery.tinymce.js")" type="text/javascript"></script>

<script type="text/javascript">

    (function(){ 

      $(function() { 
      
          $('#@ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)').tinymce({

            // Location of TinyMCE script
            script_url : '@Url.Content("~/Scripts/tinymce.3.4.5/tiny_mce.js")',
            theme : "advanced",
            
            height : "500",
            width : "100%",
            verify_html : false,
            plugins : "inlinepopups,preview,searchreplace,paste,fullscreen,wordcount",
            
            // Theme options
            theme_advanced_buttons1 : "bold,italic,underline,|,removeformat,|,sub,sup,|,charmap,|,fullscreen",
            theme_advanced_buttons2 : "cut,copy,paste,|,search,replace,|,bullist,numlist,|,undo,redo,|,cleanup,help,code,|,preview,",
            theme_advanced_buttons3 : "",
            theme_advanced_toolbar_location : "top",
            theme_advanced_toolbar_align : "left",
            theme_advanced_statusbar_location : "bottom",
            theme_advanced_resizing : false,

            // Example content CSS (should be your site CSS)
            convert_urls : false
        });

      });

    })();

</script>

@Html.TextArea(string.Empty, /* Name suffix */
    ViewData.TemplateInfo.FormattedModelValue /* Initial value */
)